package com.lovemanai.factory;

import com.lovemanai.service.Being;
import com.lovemanai.service.impl.Cat;
import com.lovemanai.service.impl.Dog;

public class BeingFactory {

	//返回Being实例的工厂
	//静态方法创建Being实例
	public static Being getBeing(String arg) {
		
		if(arg.equalsIgnoreCase("dog")) {
			//创建Dog实例
			return new Dog();
		} else {
			//创建Cat实例
			return new Cat();
		}
		
	}
	
}
